package com.test.springCloud.mapper;

import com.test.springcloud.pojo.ArticlePojo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface ArticleMapper {
    //新增文章数据
    int addArticle(ArticlePojo articlePojo);
    //获取所有的文章，进行首页数据展示
    List<ArticlePojo> getAllArticle(@Param("start")Integer start,@Param("limit")Integer limit);
    //跟据id获取文章内容
    ArticlePojo getArticleById(@Param("start") Integer start,@Param("limit") Integer limit,@Param("articleId") Integer articleId);
    //跟据id更新文章内容
    int updateArticleById(@Param("list") List<ArticlePojo> list,@Param("articleId") Integer articleId);
    //统计总条数
    List<ArticlePojo> getAllArticles();
    //统计根据id查询的条数
    ArticlePojo getArticleByIds(@Param("articleId") Integer articleId);
}
